<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>js中的对象</title>
</head>
<body>
    <script type="text/javascript">
        info={
            name:"刘星",
            age:19,
            sex:"男"
           }
        info["name"]="夏雪" //修改对象中元素
        info.sex="女"        //修改对象中元素
        delete info["age"]   //删除对象中元素
        info.city="北京"     //在对象中添加元素
        // console.log(info.sex)
        // console.log(info.name)
        // // console.log(info.age)
        // console.log(info.city)

        for(var k in info ){
            console.log(k)
            console.log(info[k])
        }
    </script>

</body>
</html>